<template>
  <div class="search-container">
    <el-input v-model="query" placeholder="请输入搜索内容" class="enhanced-search-input" @keyup.enter.native="handleSearch">
      <template #append>
        <el-icon>
          <Search />
        </el-icon>
      </template>
    </el-input>
  </div>
</template>

<script>
export default {
  name: 'SearchBox',
  data() {
    return {
      query: ''
    }
  },
  methods: {
    handleSearch() {
      console.log('Searching for:', this.query);
      // 在这里实现你的搜索逻辑
    }
  }
}
</script>
<style scoped>
.search-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #f7f7f7;
}

.enhanced-search-input {
  width: 100%;
  max-width: 400px;
  border-radius: 25px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background-color: #ffffff;
}

/* 媒体查询，适配移动端 */
@media (max-width: 768px) {
  .search-container {
    background-color: #ffffff;
  }

  .enhanced-search-input {
    width: 90%;
    max-width: 100%;
  }
}
</style>
